home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ASME's Mechanical Engine…ing Toolkit 1997 December
/
ASME's Mechanical Engineering Toolkit 1997 December.iso
/
ai
/
prlg195b.lzh
/
CHART.LZH
/
TEST02.PRO
< prev
Wrap
Text File
|
1987-03-31
|
1KB
|
47 lines
/*
File: test02.pro
Author: Peter Ross
Updated: 3 June 1985
============ SAMPLE GRAMMAR ============
*/
initial_category(trial,s).
strategy(trial,S) :-
prompt(_,'Strategy (td/bu): '),
read(S),
member(S,[td,bu]),
!.
strategy(trial,S) :-
write('Answer td. or bu. please'), nl,
strategy(trial,S).
policy(trial,P) :-
prompt(_,'Policy (bf/df): '),
read(P),
member(P,[bf,df]),
!.
policy(trial,P) :-
write('Answer df. or bf. please'), nl,
policy(trial,P).
rule(trial, s(P), [np(P), vp(P)]).
rule(trial, np(P), [det, n(P)]).
rule(trial, np(P), [np(P), pp]).
rule(trial, vp(P), [v(P)]).
rule(trial, vp(P), [v(P), np(_)]).
rule(trial, vp(P), [v(P), np(_), pp]).
rule(trial, pp, [p, np(_)]).
lexical(trial, the, [det]).
lexical(trial, a, [det]).
lexical(trial, man, [n(singular),v(singular)]).
lexical(trial, women, [n(plural)]).
lexical(trial, park, [n(singular)]).
lexical(trial, telescope, [n(singular)]).
lexical(trial, in, [p]).
lexical(trial, with, [p]).
lexical(trial, saw, [n(singular),v(singular)]).
lexical(trial, likes, [v(singular)]).